/* Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "zobjects_gtk.h"

#define ZOBJECTS_GTK_OBJECT_DATA_KEY_FLOWBOX_CHILD_WIDGET		"zobjects_gtk_object_data_key_flowbox_child_widget"

int CreateFlowBoxLayout( struct ZlangRuntime *rt , struct ZlangDirectProperty_guiflowboxlayout *guiflowboxlayout_direct_prop , int32_t row_spacing , int32_t column_spacing )
{
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = (struct ZlangDirectProperty_guiwidget_common *)guiflowboxlayout_direct_prop ;

	guiflowboxlayout_common->gtk_widget = gtk_flow_box_new() ;
	if( guiflowboxlayout_common->gtk_widget == NULL )
	{
		ThrowErrorException( rt , ZLANG_ERROR_ALLOC , EXCEPTION_MESSAGE_NEW_GTK_OBJECT_FAILED );
		return -1;
	}

	if( row_spacing >= 0 )
	{
		gtk_flow_box_set_row_spacing( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , row_spacing );
	}

	if( column_spacing > 0 )
	{
		gtk_flow_box_set_column_spacing( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , column_spacing );
	}

	gtk_flow_box_set_min_children_per_line( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , 1 );
	gtk_flow_box_set_max_children_per_line( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , G_MAXINT );

	return 0;
}

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_Create_guiwindow;
int ZlangInvokeFunction_guiflowboxlayout_Create_guiwindow( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ;
	struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ;
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(out1) ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = (struct ZlangDirectProperty_guiwidget_common *)guiflowboxlayout_direct_prop ;
	int						nret = 0 ;

	nret = CreateFlowBoxLayout( rt , guiflowboxlayout_direct_prop , -1 , -1 ) ;
	if( nret )
	{
		UnreferObject( rt , out1 );
		return 0;
	}

	TRANSFER_INPUT_OBJECT_TO_NEW_OBJECT( guiflowboxlayout_common->guiwindow_obj , in1 )

	return 0;
}

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_Create_guiwindow_int;
int ZlangInvokeFunction_guiflowboxlayout_Create_guiwindow_int( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ;
	struct ZlangObject				*in2 = GetInputParameterInLocalObjectStack(rt,2) ;
	struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ;
	int32_t						spacing ;
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(out1) ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = (struct ZlangDirectProperty_guiwidget_common *)guiflowboxlayout_direct_prop ;
	int						nret = 0 ;

	CallRuntimeFunction_int_GetIntValue( rt , in2 , & spacing );

	nret = CreateFlowBoxLayout( rt , guiflowboxlayout_direct_prop , spacing , spacing ) ;
	if( nret )
	{
		UnreferObject( rt , out1 );
		return 0;
	}

	TRANSFER_INPUT_OBJECT_TO_NEW_OBJECT( guiflowboxlayout_common->guiwindow_obj , in1 )

	return 0;
}

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_Create_guiwindow_int_int;
int ZlangInvokeFunction_guiflowboxlayout_Create_guiwindow_int_int( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ;
	struct ZlangObject				*in2 = GetInputParameterInLocalObjectStack(rt,2) ;
	struct ZlangObject				*in3 = GetInputParameterInLocalObjectStack(rt,3) ;
	struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ;
	int32_t						row_spacing ;
	int32_t						column_spacing ;
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(out1) ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = (struct ZlangDirectProperty_guiwidget_common *)guiflowboxlayout_direct_prop ;
	int						nret = 0 ;

	CallRuntimeFunction_int_GetIntValue( rt , in2 , & row_spacing );
	CallRuntimeFunction_int_GetIntValue( rt , in3 , & column_spacing );

	nret = CreateFlowBoxLayout( rt , guiflowboxlayout_direct_prop , row_spacing , column_spacing ) ;
	if( nret )
	{
		UnreferObject( rt , out1 );
		return 0;
	}

	TRANSFER_INPUT_OBJECT_TO_NEW_OBJECT( guiflowboxlayout_common->guiwindow_obj , in1 )

	return 0;
}

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_Append_object;
int ZlangInvokeFunction_guiflowboxlayout_Append_object( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(obj) ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = (struct ZlangDirectProperty_guiwidget_common *)guiflowboxlayout_direct_prop ;
	struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ;
	struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ;
	char						*guictl_direct_prop = GetObjectDirectProperty(in1) ;
	struct ZlangDirectProperty_guiwidget_common	*guictl_common = (struct ZlangDirectProperty_guiwidget_common *)guictl_direct_prop ;
	GtkWidget					*child_widget = NULL ;

	gtk_flow_box_append( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , GetControlParentGtkWidget(guictl_common) );
	child_widget = gtk_widget_get_last_child(guiflowboxlayout_common->gtk_widget);
	g_object_set_data( G_OBJECT(child_widget) , ZOBJECTS_GTK_OBJECT_DATA_KEY_FLOWBOX_CHILD_WIDGET , GetControlParentGtkWidget(guictl_common) );

	TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT

	return 0;
}

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_Prepend_object;
int ZlangInvokeFunction_guiflowboxlayout_Prepend_object( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(obj) ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = (struct ZlangDirectProperty_guiwidget_common *)guiflowboxlayout_direct_prop ;
	struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ;
	struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ;
	char						*guictl_direct_prop = GetObjectDirectProperty(in1) ;
	struct ZlangDirectProperty_guiwidget_common	*guictl_common = (struct ZlangDirectProperty_guiwidget_common *)guictl_direct_prop ;
	GtkWidget					*child_widget = NULL ;

	gtk_flow_box_prepend( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , GetControlParentGtkWidget(guictl_common) );
	child_widget = gtk_widget_get_first_child(guiflowboxlayout_common->gtk_widget);
	g_object_set_data( G_OBJECT(child_widget) , ZOBJECTS_GTK_OBJECT_DATA_KEY_FLOWBOX_CHILD_WIDGET , GetControlParentGtkWidget(guictl_common) );

	TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT

	return 0;
}

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_Insert_int_object;
int ZlangInvokeFunction_guiflowboxlayout_Insert_int_object( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(obj) ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = (struct ZlangDirectProperty_guiwidget_common *)guiflowboxlayout_direct_prop ;
	struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ;
	struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,2) ;
	int32_t						pos ;
	char						*guictl_direct_prop = GetObjectDirectProperty(in1) ;
	struct ZlangDirectProperty_guiwidget_common	*guictl_common = (struct ZlangDirectProperty_guiwidget_common *)guictl_direct_prop ;
	GtkFlowBoxChild					*child_widget = NULL ;

	CallRuntimeFunction_int_GetIntValue( rt , in1 , & pos );

	gtk_flow_box_insert( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , GetControlParentGtkWidget(guictl_common) , pos );
	child_widget = gtk_flow_box_get_child_at_index(GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget),pos);
	g_object_set_data( G_OBJECT(child_widget) , ZOBJECTS_GTK_OBJECT_DATA_KEY_FLOWBOX_CHILD_WIDGET , GetControlParentGtkWidget(guictl_common) );

	TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT

	return 0;
}

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_SelectItem_int;
int ZlangInvokeFunction_guiflowboxlayout_SelectItem_int( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(obj) ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = (struct ZlangDirectProperty_guiwidget_common *)guiflowboxlayout_direct_prop ;
	struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ;
	int32_t						pos ;
	GtkFlowBoxChild					*child = NULL ;

	CallRuntimeFunction_int_GetIntValue( rt , in1 , & pos );

	child = gtk_flow_box_get_child_at_index( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , pos );
	if( child )
	{
		gtk_flow_box_select_child( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , child );
	}

	return 0;
}

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_SetChildActivatedEventCallback_functionptr;
int ZlangInvokeFunction_guiflowboxlayout_SetChildActivatedEventCallback_functionptr( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangDirectProperty_guibutton		*guibutton_direct_prop = GetObjectDirectProperty(obj) ;
	struct ZlangDirectProperty_guiwidget_common	*guibutton_common = & (guibutton_direct_prop->common) ;
	struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ;
	struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ;

	ADD_CONTROL_FLOWBOX_CHILD_ACTIVATED_CALLBACK_IN_CREATE( guibutton_common->guiwindow_obj , obj , GTK_EVENT_CHILD_ACTIVATED , in1 )

	TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT

	return 0;
}

ZLANG_INVOKE_FUNCTION_guiwidget_all_common_functions( flowboxlayout )

ZLANG_INVOKE_FUNCTION_guilayout_all_common_functions( flowboxlayout )

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_GetChildActivatedWithType_object;
int ZlangInvokeFunction_guiflowboxlayout_GetChildActivatedWithType_object( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(obj) ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = & (guiflowboxlayout_direct_prop->common) ;
	struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ;
	struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ;
	GtkWidget					*child_gtk_widget = NULL ;
	void						*type_guictl_obj_direct_prop = GetObjectDirectProperty(in1) ; \
	struct ZlangDirectProperty_guiwidget_common	*type_guictl_common = (struct ZlangDirectProperty_guiwidget_common *)type_guictl_obj_direct_prop ; \
	struct ZlangObject				*clone_guictl_obj = NULL ; \
	struct ZlangDirectProperty_guiwidget_common	*clone_guictl_obj_direct_prop = NULL ; \
	int						nret = 0 ;

	child_gtk_widget = g_object_get_data( G_OBJECT(guiflowboxlayout_direct_prop->child_activated_widget) , ZOBJECTS_GTK_OBJECT_DATA_KEY_FLOWBOX_CHILD_WIDGET ) ;
	if( type_guictl_common->gtk_widget_type_id == 0 || type_guictl_common->gtk_widget_type_id != G_OBJECT_TYPE(child_gtk_widget) )
	{
		UnreferObject( rt , out1 );
		return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_GTK_WIDGET_TYPE_NOT_MATCHED );
	}
	
	clone_guictl_obj = CloneObjectInTmpStack( rt , NULL , in1 ) ;
	if( clone_guictl_obj == NULL )
	{
		UnreferObject( rt , out1 );
		return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_CLONE_OBJECT_FAILED );
	}
	
	clone_guictl_obj_direct_prop = GetObjectDirectProperty(clone_guictl_obj) ;
	clone_guictl_obj_direct_prop->gtk_widget = child_gtk_widget ;
	clone_guictl_obj_direct_prop->guiwindow_obj = guiflowboxlayout_common->guiwindow_obj ;
	
	nret = ReferObject( rt , out1 , clone_guictl_obj ) ;
	if( nret )
	{
		UnreferObject( rt , out1 );
		return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_REFER_OBJECT_FAILED );
	}
	
	return 0;
}

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_GetSelectItemNo;
int ZlangInvokeFunction_guiflowboxlayout_GetSelectItemNo( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(obj) ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = (struct ZlangDirectProperty_guiwidget_common *)guiflowboxlayout_direct_prop ;
	struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,2) ;
	GList						*selected_list = NULL ;
	GtkFlowBoxChild					*selected_child = NULL ;
	int32_t						pos ;

	selected_list = gtk_flow_box_get_selected_children( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) ) ;
	if( selected_list == NULL )
	{
		CallRuntimeFunction_int_SetIntValue( rt , out1 , -1 );
		return 0;
	}

	selected_child = (GtkFlowBoxChild *)(selected_list->data) ;
	pos = gtk_flow_box_child_get_index( selected_child ) ;
	CallRuntimeFunction_int_SetIntValue( rt , out1 , pos );

	return 0;
}

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_Remove_int;
int ZlangInvokeFunction_guiflowboxlayout_Remove_int( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(obj) ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = & (guiflowboxlayout_direct_prop->common) ;
	struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ;
	int32_t						pos ;
	GtkFlowBoxChild					*child = NULL ;

	CallRuntimeFunction_int_GetIntValue( rt , in1 , & pos );

	child = gtk_flow_box_get_child_at_index( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , pos ) ;
	gtk_flow_box_remove( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , GTK_WIDGET(child) );

	child = gtk_flow_box_get_child_at_index( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , pos );
	if( child == NULL )
	{
		child = gtk_flow_box_get_child_at_index( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , pos-1 );
	}
	if( child )
	{
		gtk_flow_box_select_child( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , child );
		guiflowboxlayout_direct_prop->child_activated_widget = child ;
	}

	return 0;
}

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_RemoveChildActivated;
int ZlangInvokeFunction_guiflowboxlayout_RemoveChildActivated( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(obj) ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = & (guiflowboxlayout_direct_prop->common) ;
	int32_t						pos ;
	GtkFlowBoxChild					*child = NULL ;

	if( guiflowboxlayout_direct_prop->child_activated_widget == NULL )
		return 0;

	pos = gtk_flow_box_child_get_index( guiflowboxlayout_direct_prop->child_activated_widget ) ;

	gtk_flow_box_remove( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , GTK_WIDGET(guiflowboxlayout_direct_prop->child_activated_widget) );

	child = gtk_flow_box_get_child_at_index( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , pos );
	if( child == NULL )
	{
		child = gtk_flow_box_get_child_at_index( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , pos-1 );
	}
	if( child )
	{
		gtk_flow_box_select_child( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) , child );
		guiflowboxlayout_direct_prop->child_activated_widget = child ;
	}

	return 0;
}

ZlangInvokeFunction ZlangInvokeFunction_guiflowboxlayout_RemoveAll;
int ZlangInvokeFunction_guiflowboxlayout_RemoveAll( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(obj) ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = & (guiflowboxlayout_direct_prop->common) ;

	gtk_flow_box_remove_all( GTK_FLOW_BOX(guiflowboxlayout_common->gtk_widget) );

	return 0;
}

ZlangCreateDirectPropertyFunction ZlangCreateDirectProperty_guiflowboxlayout;
void *ZlangCreateDirectProperty_guiflowboxlayout( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangDirectProperty_guiflowboxlayout		*guiflowboxlayout_prop = NULL ;
	struct ZlangDirectProperty_guiwidget_common	*guiflowboxlayout_common = NULL ;
	
	guiflowboxlayout_prop = (struct ZlangDirectProperty_guiflowboxlayout *)ZLMALLOC( sizeof(struct ZlangDirectProperty_guiflowboxlayout) ) ;
	if( guiflowboxlayout_prop == NULL )
	{
		SET_RUNTIME_ERROR( rt , RUNTIME_ERROR , ZLANG_ERROR_ALLOC , "alloc memory for entity" )
		return NULL;
	}
	memset( guiflowboxlayout_prop , 0x00 , sizeof(struct ZlangDirectProperty_guiflowboxlayout) );

	guiflowboxlayout_common = (struct ZlangDirectProperty_guiwidget_common *)guiflowboxlayout_prop ;
	guiflowboxlayout_common->gtk_widget_type_id = GTK_TYPE_FLOW_BOX ;
	
	return guiflowboxlayout_prop;
}

ZlangDestroyDirectPropertyFunction ZlangDestroyDirectProperty_guiflowboxlayout;
void ZlangDestroyDirectProperty_guiflowboxlayout( struct ZlangRuntime *rt , struct ZlangObject *obj )
{
	struct ZlangDirectProperty_guiflowboxlayout	*guiflowboxlayout_direct_prop = GetObjectDirectProperty(obj) ;
	
	ZLFREE( guiflowboxlayout_direct_prop );
	
	return;
}

ZlangSummarizeDirectPropertySizeFunction ZlangSummarizeDirectPropertySize_guiflowboxlayout;
void ZlangSummarizeDirectPropertySize_guiflowboxlayout( struct ZlangRuntime *rt , struct ZlangObject *obj , size_t *summarized_obj_size , size_t *summarized_direct_prop_size )
{
	SUMMARIZE_SIZE( summarized_direct_prop_size , sizeof(struct ZlangDirectProperty_guiflowboxlayout) )
	return;
}

static struct ZlangDirectFunctions direct_funcs_guiflowboxlayout =
	{
		ZLANG_OBJECT_guiflowboxlayout , /* char *ancestor_name */
		
		ZlangCreateDirectProperty_guiflowboxlayout , /* ZlangCreateDirectPropertyFunction *create_entity_func */
		ZlangDestroyDirectProperty_guiflowboxlayout , /* ZlangDestroyDirectPropertyFunction *destroy_entity_func */
		
		NULL , /* ZlangFromCharPtrFunction *from_char_ptr_func */
		NULL , /* ZlangToStringFunction *to_string_func */
		NULL , /* ZlangFromDataPtrFunction *from_data_ptr_func */
		NULL , /* ZlangGetDataPtrFunction *get_data_ptr_func */
		
		NULL , /* ZlangOperatorFunction *oper_PLUS_func */
		NULL , /* ZlangOperatorFunction *oper_MINUS_func */
		NULL , /* ZlangOperatorFunction *oper_MUL_func */
		NULL , /* ZlangOperatorFunction *oper_DIV_func */
		NULL , /* ZlangOperatorFunction *oper_MOD_func */
		
		NULL , /* ZlangUnaryOperatorFunction *unaryoper_NEGATIVE_func */
		NULL , /* ZlangUnaryOperatorFunction *unaryoper_NOT_func */
		NULL , /* ZlangUnaryOperatorFunction *unaryoper_BIT_REVERSE_func */
		NULL , /* ZlangUnaryOperatorFunction *unaryoper_PLUS_PLUS_func */
		NULL , /* ZlangUnaryOperatorFunction *unaryoper_MINUS_MINUS_func */
		
		NULL , /* ZlangCompareFunction *comp_EGUAL_func */
		NULL , /* ZlangCompareFunction *comp_NOTEGUAL_func */
		NULL , /* ZlangCompareFunction *comp_LT_func */
		NULL , /* ZlangCompareFunction *comp_LE_func */
		NULL , /* ZlangCompareFunction *comp_GT_func */
		NULL , /* ZlangCompareFunction *comp_GE_func */
		
		NULL , /* ZlangLogicFunction *logic_AND_func */
		NULL , /* ZlangLogicFunction *logic_OR_func */
		
		NULL , /* ZlangLogicFunction *bit_AND_func */
		NULL , /* ZlangLogicFunction *bit_XOR_func */
		NULL , /* ZlangLogicFunction *bit_OR_func */
		NULL , /* ZlangLogicFunction *bit_MOVELEFT_func */
		NULL , /* ZlangLogicFunction *bit_MOVERIGHT_func */
		
		ZlangSummarizeDirectPropertySize_guiflowboxlayout , /* ZlangSummarizeDirectPropertySizeFunction *summarize_direct_prop_size_func */
	} ;

ZlangImportObjectFunction ZlangImportObject_guiflowboxlayout;
struct ZlangObject *ZlangImportObject_guiflowboxlayout( struct ZlangRuntime *rt )
{
	struct ZlangObject	*obj = NULL ;
	struct ZlangFunction	*func = NULL ;
	int			nret = 0 ;
	
	nret = ImportObject( rt , & obj , ZLANG_OBJECT_guiflowboxlayout , & direct_funcs_guiflowboxlayout , sizeof(struct ZlangDirectFunctions) , NULL ) ;
	if( nret )
	{
		SET_RUNTIME_ERROR( rt , RUNTIME_ERROR , ZLANG_ERROR_LINK_FUNC_TO_ENTITY , "import object to global objects heap" )
		return NULL;
	}
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_Create_guiwindow , ZLANG_OBJECT_guiflowboxlayout , "Create" , ZLANG_OBJECT_guiwindow,NULL , NULL ) ;
	if( func == NULL )
		return NULL;
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_Create_guiwindow_int , ZLANG_OBJECT_guiflowboxlayout , "Create" , ZLANG_OBJECT_guiwindow,NULL , ZLANG_OBJECT_int,NULL , NULL ) ;
	if( func == NULL )
		return NULL;
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_Create_guiwindow_int_int , ZLANG_OBJECT_guiflowboxlayout , "Create" , ZLANG_OBJECT_guiwindow,NULL , ZLANG_OBJECT_int,NULL , ZLANG_OBJECT_int,NULL , NULL ) ;
	if( func == NULL )
		return NULL;
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_Append_object , ZLANG_OBJECT_guiflowboxlayout , "Append" , ZLANG_OBJECT_object,NULL , NULL ) ;
	if( func == NULL )
		return NULL;
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_Prepend_object , ZLANG_OBJECT_guiflowboxlayout , "Prepend" , ZLANG_OBJECT_object,NULL , NULL ) ;
	if( func == NULL )
		return NULL;
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_Insert_int_object , ZLANG_OBJECT_guiflowboxlayout , "Insert" , ZLANG_OBJECT_int,NULL , ZLANG_OBJECT_object,NULL , NULL ) ;
	if( func == NULL )
		return NULL;
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_SelectItem_int , ZLANG_OBJECT_guiflowboxlayout , "SelectItem" , ZLANG_OBJECT_int,NULL , NULL ) ;
	if( func == NULL )
		return NULL;
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_SetChildActivatedEventCallback_functionptr , ZLANG_OBJECT_guiflowboxlayout , "SetChildActivatedEventCallback" , ZLANG_OBJECT_functionptr,NULL , NULL ) ;
	if( func == NULL )
		return NULL;
	
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_all_common_functions( flowboxlayout )

	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guilayout_all_common_functions( flowboxlayout )
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_GetChildActivatedWithType_object , ZLANG_OBJECT_object , "GetChildActivatedWithType" , ZLANG_OBJECT_object,NULL , NULL ) ;
	if( func == NULL )
		return NULL;
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_GetSelectItemNo , ZLANG_OBJECT_int , "GetSelectItemNo" , NULL ) ;
	if( func == NULL )
		return NULL;
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_Remove_int , ZLANG_OBJECT_void , "Remove" , ZLANG_OBJECT_int,NULL , NULL ) ;
	if( func == NULL )
		return NULL;
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_RemoveChildActivated , ZLANG_OBJECT_void , "RemoveChildActivated" , NULL ) ;
	if( func == NULL )
		return NULL;
	
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_guiflowboxlayout_RemoveAll , ZLANG_OBJECT_void , "RemoveAll" , NULL ) ;
	if( func == NULL )
		return NULL;
	
	return obj ;
}

